import axios from 'axios'
//请求拦截器
axios.interceptors.request.use(function(config){//请求之前
    config.headers.authorization=window.sessionStorage.getItem('token')
    return config
})

//响应拦截器
axios.interceptors.response.use(function(response){//对相应数据所做的操作
    if(response.data.code==10086){
        location.href='/login'
        window.sessionStorage.clear()
    }else{
        return response
    }
})


